<template>
  <view>
    <u-navbar :is-back="true" :is-fixed="true" title="品牌执法"></u-navbar>
    <scroll-view
      scroll-y
      scroll-with-animation
      style="height: calc(100vh - 50px)"
      :show-scrollbar="false"
    >
      <view class="mt-3 pl-2 pr-2">
        <view v-for="(item, itemIndex) in tabContents" :key="itemIndex">
          <view
            class="u-line pb-2 mt-1"
            @click="open('tabbar/index/brandEnforcementDi')"
          >
            <view class="dfex">
              <view>{{ item.name }}</view>
              <view>2024-2-16</view>
            </view>
            <view class="mt-2 text-999999 font-12">华东政法大学</view>
          </view>
        </view>
      </view>
    </scroll-view>
  </view>
</template>

<script>
import $H from "@/common/free-lib/request.js";

export default {
  data() {
    return {
      tabContents: [
        {
          name: "内容1",
          Image: "/static/logo.png",
          fouShu: 100,
        },
        {
          name: "内容2",
          Image: "/static/logo.png",
          fouShu: 200,
        },
        {
          name: "内容2",
          Image: "/static/logo.png",
          fouShu: 200,
        },
        {
          name: "内容2",
          Image: "/static/logo.png",
          fouShu: 200,
        },
      ],
      pageNo: 1,
      pageSize: 10,
    };
  },
  onLoad() {
    this.getBrandEnforcementList(this.pageNo, this.pageSize);
  },
  onReachBottom() {
    this.pageNo = this.pageNo + 1;
    this.getBrandEnforcementList(this.pageNo, this.pageSize);
  },
  methods: {
    open(path) {
      uni.navigateTo({
        url: "/pages/" + path,
      });
    },
    getBrandEnforcementList(no, size) {
      $H.get(
        "/agriculture/brandEnforcement/upper/list",
        {
          pageNo: no,
          pageSize: size,
        },
        {}
      )
        .then((res) => {
          let resList = [];
          for (let i = 0; i < res.result.records.length; i++) {
            const item = res.result.records[i];
            resList.push({
				enterpriseName:this.enterpriseName,
				enforcementInstructions:this.enforcementInstructions,
				createTime:this.createTime
            });
          }
          this.tabContents[2] = resList;
        })
        .catch((error) => {
          console.error("请求出错", error); // 处理任何错误
        });
    },
  },
};
</script>

<style>
</style>